﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using MatTroi.vn.Models;

namespace MatTroi.vn.Models
{
    public class MenuContent
    {
        Entities db = new Entities();
        public List<tbl_DanhMuc> lstdm { get; set; }
        public List<tbl_DanhMuc>listDanhMuc { get; set; }
        public List<tbl_Website> lstWebSite { get; set; }
        public List<tbl_Website> GetWebDanhMuc(int ID)
        {
            var dmWeb = db.tbl_WebDM.Where(e => e.tbl_DanhMuc.ID_DanhMuc == ID && e.tbl_DanhMuc.IsHot == false).OrderByDescending(e => e.tbl_Website.XepHang).ToList();
            List<tbl_Website> Web = new List<tbl_Website>();
            foreach (var item in dmWeb)
            {
                Web.Add(item.tbl_Website);
            }
            return Web;
        }
} 
}